#ifndef _AUDIO_H
#define _AUDIO_H

/* Headers *******************************************************************************************************/

//typedef ALCdevice;
//typedef ALCcontext;
#include <al.h>
#include <alc.h>
#include <alut.h>

/* Class Definition **********************************************************************************************/
class Audio
{
	ALCdevice	*alDevice;
	ALCcontext	*alContext;

public:
	static Audio* Instance();

	Audio();
	~Audio();

	bool Init();
	void Release();			
	void SetListener(float x, float y, float z, float player_angle);

	bool setSource(unsigned int id, long buffer, float x, float y, float z, float gain, bool loop);
	void playSource(unsigned int id);
	void stopSource(long id);
	void deleteSource(unsigned int* id);
	void genSource(unsigned int* id);
	bool loadWave(char* buffer, unsigned int* bfr);
	bool deleteBuffer(unsigned int* id);
	void moveTo(unsigned int id, float x, float y, float z);

	bool isPlaying(unsigned int id);
private:
	static Audio* _instance;
};

#endif